import * as cc from 'cc';
const { ccclass, property } = cc._decorator;
@ccclass('HelloWorld')
export class HelloWorld extends cc.Component {
    @property({ type: [cc.Prefab] })
    pagePrefabs: cc.Prefab[] = [];

    start() {
        cc.profiler.hideStats();
        let pageID = 0;
        let pageNode = cc.instantiate(this.pagePrefabs[pageID++ % 3]);
        pageNode.setParent(this.node);
        this.schedule(() => {
            pageNode.removeFromParent();
            pageNode.destroy();
            pageNode = cc.instantiate(this.pagePrefabs[pageID++ % 3]);
            pageNode.setParent(this.node);
        }, 2);
    }
}